import 'package:flutter/material.dart';

void main() {
  runApp(const HomePage());
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter App'),
        ),
        body: const Text('flutter'),
        // TODO 左侧抽屉
        drawer: const Drawer(
          child: Column(
            children: [
              DrawerHeader(
                decoration: BoxDecoration(
                  // color: Colors.red,
                  image: DecorationImage(
                      image: NetworkImage(
                          'https://www.itying.com/images/flutter/2.png'),
                      fit: BoxFit.cover),
                ),
                child: Column(
                  children: [
                    ListTile(
                      leading: CircleAvatar(
                        child: Icon(Icons.people),
                      ),
                      title: Text('张山'),
                    ),
                  ],
                ),
              ),
              ListTile(
                leading: CircleAvatar(
                  child: Icon(Icons.people),
                ),
                title: Text('个人中心'),
              ),
              Divider(),
              ListTile(
                leading: CircleAvatar(
                  child: Icon(Icons.settings),
                ),
                title: Text('系统设置'),
              )
            ],
          ),
        ),
        endDrawer: const Drawer(
          child: Text('2222222222'),
        ),
      ),
    );
  }
}
